function generatePhoneNumber() {
    let prefix = [130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 145, 147, 150, 151, 152, 153, 155, 156, 157, 158, 159, 186, 187, 188];
    let prefixIndex = Math.floor(Math.random() * prefix.length);
    let phone = prefix[prefixIndex].toString();
    for (let i = 0; i < 8; i++) {
      phone += Math.floor(Math.random() * 10).toString();
    }
    return phone;
  }
  
    // 生成mock数据
  const generateData = async () => {
    const { data } = await axios('http://localhost:8080/wuhan_events')
    let features = data.features
    features = features.map((item, index) => {
      let randomNum = (Math.random().toFixed(6) * 1000000).toString()
      const car_num = `鄂A${randomNum}`
      const phone = generatePhoneNumber()
      const id = (10000 + index).toString()
      const event_num = `SJ${100000 + index}`
      const area = '区域1'
      const propertiesInfo = {
        name: '碰撞',
        level: 2,
        car_num, phone, id, event_num, area
      }
      return {
        ...item,
        properties: propertiesInfo
      }
    })
    const resData = {
      type: 'FeatureCollection',
      features: features
    }
    console.log(JSON.stringify(resData));
  }